﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="persondoc_space_list.aspx.cs" Inherits="Ccit.OA.PersonDoc.persondoc_space_list" %>
<%@ Register assembly="DevExpress.Web.ASPxGridView.v8.1" namespace="DevExpress.Web.ASPxGridView" tagprefix="dxwgv" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v8.1" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>
<%@ Register TagPrefix="ccit" Namespace="Ccit.ServerControls" Assembly="Ccit.ServerControls.ActionForm" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>个人档案空间设置</title>
    <script language="javascript" type="text/javascript" src="../script/jquery.js"></script>
    <script language="javascript" type="text/javascript" src="../script/StringClass_Ext.js"></script>
    <script language="javascript" type="text/javascript" src="../script/jsonlib.js"></script>
    <script language="javascript" src="../script/jwindow.js"></script>
    <script language="javascript" src="../script/jbase64.js" type="text/javascript"></script>
    <script type="text/javascript">
        //复选框选择
         var objState ; 
        function doDataGridItemSel(obj)
        {
          if ( objState != null )
          {
             objState.style.color = "";
             objState.style.backgroundColor = "";
          } 
          obj.style.color = "#fffeee";
          obj.style.backgroundColor = "#a0a0a0";        
          objState = obj;		                       
        }	
        function OnGridSelectionChanged(){           
            dgMain.GetSelectedFieldValues("SId",OnGridSelectionComplete);
        }
        
        function OnGridSelectionComplete(values){
            document.getElementById("_hidDocID").value=values;            
        }
        function SetSpace(oType) { //v6.0
            var vUserId = document.getElementById("_hidDocID").value;
           // alert(vUserId);
            if(oType=="0")
            {
                if(vUserId=="")
                {
                    alert("您尚未选择需要设置的用户信息!")
                    return;
                }
            }            
             var obj = document.getElementById('PerDoc');
             if(obj){
              obj.style.display=''; //点击按钮，div层显示    
             }
        }
        function doSave()
        {
            var vspace = document.getElementById("txtSetSpace").value;
            if(vspace.Trim()!="")
            {
                var vUserId = document.getElementById("_hidDocID").value;
                var MsSpace = {};
                MsSpace.UserId = vUserId;
                MsSpace.SpaceSize = vspace;
                var jsonExpr = JSON.stringify(MsSpace,function(key,value){return value;}); 
                MsSpace = null;
                PageMethods.DoOperate(jsonExpr,ClientCallBack); 
            }
            else
            {
                alert("您尚未输入设置大小,请输入!");
            }
        }
        function ClientCallBack(vResult)
        {
             eval("ObjResult =" +vResult);
		    if(ObjResult.resulttype!="-999")
		    {
		        __doPostBack("lnbQuery","");
		        alert(ObjResult.message); 
		        document.getElementById('PerDoc').style.display='none'
		        return true;
		    }
		    else
		    {
		        alert(ObjResult.message); 		        
		        document.getElementById('PerDoc').style.display='none'
		        return false;
		    }    		
        }
    </script>
</head>
<body>
    <ccit:ActionForm id="form1" runat="server">
    
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
    </asp:ScriptManager> 
     <input type="hidden" id="_hidDocID" runat="server" />
    <table class="tbToolbar" cellpadding="0" cellspacing="0" width="98%" align="center">
                    <tr>
                        <td align="left">
                            <div class="tbSeparator"></div>
                        </td>
                        <td width="100%" class="titlebar">  
                        </td>                
                        <td align="right">
                            <nobr>
                                关键字:                                  
                                <asp:TextBox ID="txttName" CssClass="input" Width="70" runat="server"></asp:TextBox>                    
                                &nbsp;档案空间:<asp:DropDownList ID="ddlArchives" CssClass="inputselect" Width="50" runat="server">
                               <asp:ListItem Value="0">></asp:ListItem>
                                <asp:ListItem Value="1">>=</asp:ListItem>
                                 <asp:ListItem Value="2">=</asp:ListItem>
                                <asp:ListItem Value="3"><</asp:ListItem>
                                <asp:ListItem Value="4"><=</asp:ListItem>
                            </asp:DropDownList> 
                                <asp:TextBox ID="txtArchives" CssClass="input" Width="60" runat="server"></asp:TextBox>
                                M
                                &nbsp;
                                使用空间:<asp:DropDownList ID="ddlAlready" CssClass="inputselect" Width="50" runat="server">
                                 <asp:ListItem Value="0">></asp:ListItem>
                                <asp:ListItem Value="1">>=</asp:ListItem>
                                 <asp:ListItem Value="2">=</asp:ListItem>
                                <asp:ListItem Value="3"><</asp:ListItem>
                                <asp:ListItem Value="4"><=</asp:ListItem>
                            </asp:DropDownList> 
                                <asp:TextBox ID="txtAlready" CssClass="input" Width="60" runat="server"></asp:TextBox>
                                M
                                &nbsp;<asp:LinkButton ID="lnbQuery" CssClass="linktext" runat="server" onclick="lnbQuery_Click" 
                                >
                                    <img src="../images/toolbar/search.gif" />查询
                                </asp:LinkButton> 
                                 <a  id="A1" Runat="server" class="linktext"  
                                href="javascript:SetSpace('0')">
                                    <img src="../images/toolbar/Displace.gif" />空间设置
                                 </a> 
                                <a  id="lnbAdd" Runat="server" class="linktext"  
                                href="javascript:SetSpace('1')">
							        <img src="../images/toolbar/new.gif" border="0">设置全部
						        </a>
						      
                             </nobr>
                        </td> 
                    </tr>
       </table>
       <div id="PerDoc" style="position: absolute; z-index: 99; top: 80px; left: 400px; display: none;">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <table width="300" border="1" cellpadding="0" cellspacing="0" bordercolor="#ECE9D8" class="tableborder"
                         >
                        <tbody>
                            <tr>
                                <td height="35">
                                    <table width="70%" border="0" align="center" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td> 
                                                    <nobr>
                                                    空间设置：
                                                    <input type="text" id="txtSetSpace" class="input" width="60" runat="server" />
                                                    M</nobr> 
                                            </td>
                                        </tr>
                                        <tr>
                                        <td align="center">
                                            <nor>
                                                <input type="button" id="btnSave" value="确定" onclick="doSave();" />
                                                &nbsp;
                                                <input type="button" id="btnClose"  onclick="document.getElementById('PerDoc').style.display='none';"value="取消" />
                                            </nor></td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </tbody>                    
                    </table>
                   </ContentTemplate>
                </asp:UpdatePanel>
          </div>
       <table  cellpadding="0" cellspacing="0" width="98%" align="center">
            <tr>
                <td>
                    <dxwgv:ASPxGridView ID="dgMain" runat="server"
                                AutoGenerateColumns="False" Width="100%" KeyFieldName="SId" 
                                            Settings-ShowGroupPanel="true" >
                                             <SettingsText GroupPanel="分组栏" />   
                                            <SettingsPager AlwaysShowPager="True" PageSize="15">
                                                <FirstPageButton Visible="True">
                                                </FirstPageButton>
                                                <LastPageButton Visible="True">
                                                </LastPageButton>
                                            </SettingsPager>
                                             <Styles>
                                                <Row CssClass=""></Row>
                                                <AlternatingRow  CssClass="" Enabled="true"/>
                                                <SelectedRow  CssClass=""></SelectedRow>                
                                            </Styles>  
                                            <Columns>
                                                 <dxwgv:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0" Width="2%">
                                                    <HeaderTemplate>
                                                        <input type="checkbox" id="chbCheck" runat="server" onclick="dgMain.SelectAllRowsOnPage(this.checked);"
                                                            style="vertical-align: middle;" title="Select/Unselect all rows on the page"></input>
                                                    </HeaderTemplate>
                                                    <HeaderStyle Paddings-PaddingTop="1" Paddings-PaddingBottom="1" HorizontalAlign="Center">
                                                        <Paddings PaddingTop="1px" PaddingBottom="1px"></Paddings>
                                                    </HeaderStyle>
                                                </dxwgv:GridViewCommandColumn>
                                                <dxwgv:GridViewDataTextColumn Caption="姓名" VisibleIndex="1" width="15%" FieldName="userName">
                                                 <HeaderStyle HorizontalAlign="Center" />
                                                 <CellStyle HorizontalAlign="left"></CellStyle>
                                                </dxwgv:GridViewDataTextColumn>
                                                <dxwgv:GridViewDataTextColumn Caption="所属部门" VisibleIndex="2" width="8%" FieldName="DeptName">
                                                  <HeaderStyle HorizontalAlign="Center" />
                                                  <CellStyle HorizontalAlign="left"></CellStyle>
                                                </dxwgv:GridViewDataTextColumn>
                                                 <dxwgv:GridViewDataTextColumn Caption="职位" VisibleIndex="3" width="5%" FieldName="PostName">
                                                  <HeaderStyle HorizontalAlign="Center" />
                                                  <CellStyle HorizontalAlign="left"></CellStyle>
                                                </dxwgv:GridViewDataTextColumn>                                                 
                                                 <dxwgv:GridViewDataTextColumn Caption="档案空间(M)" VisibleIndex="4" width="8%" FieldName="Archives">
                                                  <HeaderStyle HorizontalAlign="Center" />
                                                  <CellStyle HorizontalAlign="right"></CellStyle>
                                                </dxwgv:GridViewDataTextColumn>
                                                 <dxwgv:GridViewDataTextColumn Caption="已使用空间(M)" VisibleIndex="5" width="12%" FieldName="Already">
                                                  <HeaderStyle HorizontalAlign="Center" />
                                                  <CellStyle HorizontalAlign="right"></CellStyle>
                                                </dxwgv:GridViewDataTextColumn>
                                                 <dxwgv:GridViewDataTextColumn Caption="剩余空间(M)" VisibleIndex="6" width="12%" FieldName="Residual">
                                                  <HeaderStyle HorizontalAlign="Center" />
                                                  <CellStyle HorizontalAlign="right"></CellStyle>
                                                </dxwgv:GridViewDataTextColumn> 
                                            </Columns>
                                             <%-- 复选框选择脚本事件 --%>
                                                    <ClientSideEvents SelectionChanged="function(s,e){OnGridSelectionChanged();}" />
                                        </dxwgv:ASPxGridView>
                </td>
            </tr>
       </table>
    </ccit:ActionForm>
</body>
</html>
